-- GENERATED SPELL FOR [Lord Victor Nefarius] --


function spell0_10162(pUnit, Event) --@Banishment of Scale,n/a--
pUnit:FullCastSpellOnTarget(16404,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 10266, 1)
end

function spell1_10162(pUnit, Event) --@Chromatic Chaos,n/a--
pUnit:FullCastSpellOnTarget(16337,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 596, 1)
end

function spell2_10162(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(22678,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 7500, 1)
end

function spell3_10162(pUnit, Event) --@Nefarian\'s Barrier,Self--
pUnit:FullCastSpellOnTarget(22663,pUnit)
pUnit:RegisterEvent('Sorts_10162', 609, 1)
end

function spell4_10162(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(22677,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 2000, 1)
end

function spell5_10162(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(22665,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 2000, 1)
end

function spell6_10162(pUnit, Event) --@Shadow Command,n/a--
pUnit:FullCastSpellOnTarget(22667,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 15259, 1)
end

function spell7_10162(pUnit, Event) --@Shadowblink,Self--
pUnit:FullCastSpellOnTarget(22664,pUnit)
pUnit:RegisterEvent('Sorts_10162', 500, 1)
end

function spell8_10162(pUnit, Event) --@Shadowblink,Self--
pUnit:FullCastSpellOnTarget(22681,pUnit)
pUnit:RegisterEvent('Sorts_10162', 500, 1)
end

function spell9_10162(pUnit, Event) --@Silence,n/a--
pUnit:FullCastSpellOnTarget(22666,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10162', 6263, 1)
end

function Sorts_10162(pUnit, Event)
local choix_sorts_10162 = math.random(0, 9)
if choix_sorts_10162 == 0 then
pUnit:RegisterEvent('spell0_10162', 1, 1)
end
if choix_sorts_10162 == 1 then
pUnit:RegisterEvent('spell1_10162', 1, 1)
end
if choix_sorts_10162 == 2 then
pUnit:RegisterEvent('spell2_10162', 1, 1)
end
if choix_sorts_10162 == 3 then
pUnit:RegisterEvent('spell3_10162', 1, 1)
end
if choix_sorts_10162 == 4 then
pUnit:RegisterEvent('spell4_10162', 1, 1)
end
if choix_sorts_10162 == 5 then
pUnit:RegisterEvent('spell5_10162', 1, 1)
end
if choix_sorts_10162 == 6 then
pUnit:RegisterEvent('spell6_10162', 1, 1)
end
if choix_sorts_10162 == 7 then
pUnit:RegisterEvent('spell7_10162', 1, 1)
end
if choix_sorts_10162 == 8 then
pUnit:RegisterEvent('spell8_10162', 1, 1)
end
if choix_sorts_10162 == 9 then
pUnit:RegisterEvent('spell9_10162', 1, 1)
end
end

function mob10162_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10162', math.random(1500, 3000), 1)
end

function mob10162_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10162_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10162_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10162, 1, 'mob10162_Action')
RegisterUnitEvent(10162, 2, 'mob10162_Leave')
RegisterUnitEvent(10162, 3, 'mob10162_Kill')
RegisterUnitEvent(10162, 4, 'mob10162_Die')
